<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes"><!-- 删除默认的苹果工具栏和菜单栏 -->
	<meta name="apple-mobile-web-app-status-bar-style" content="black" /><!-- 在web app应用下状态条（屏幕顶部条）的颜色 -->
	<meta name="format-detection" content="telephone=no"><!-- 禁止了把数字转化为拨号链接 -->
	<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″/>
	<title>学生惠</title>
	<link rel="stylesheet" href="App/Home/public/css/swiper.min.css">
	<link rel="stylesheet" href="App/Home/public/css/app.css">
	<script type="text/javascript" src="App/Home/public/js/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="App/Home/public/js/rem.js"></script>
</head>
<body>
<header class="clearfix">
	<div class="fl tag-tile">公告</div>
	<div class="fl tag-con">您的好友‘青春是道明媚的忧伤’已上线</div>
</header>

<!-- 轮播图 -->
<div class="banner">
	<div class="swiper-container">
	        <div class="swiper-wrapper">
	            <div class="swiper-slide"><img src="App/Home/public/images/banner1.jpg" alt=""></div>
	            <div class="swiper-slide"><img src="App/Home/public/images/banner1.jpg" alt=""></div>
	            <div class="swiper-slide"><img src="App/Home/public/images/banner1.jpg" alt=""></div>
	        </div>
	        <!-- 分页 -->
	        <div class="swiper-pagination"></div>
	</div>
</div>

<!-- 主题内容 -->
<section class="content clearfix">
	<div class="left fl">
		<section class="brand">
			<div class="red">
				<span>爱心红包商家</span>
			</div>
			<div class="brand-content clearfix">
				<div class="title fl"><h3>国<br>际<br>品<br>牌</h3></div>
				<div class="section fr">
					<div class="clearfix">
						<a class="border-r btn-international-movie" data-name="spell" data-id="123">
							<img src="App/Home/public/images/movie.png" alt="">
							<p>国际影城</p>
						</a>
						<a class="btn-international-store1" data-name="spell" data-id="">
							<img src="App/Home/public/images/store3.png" alt="">
							<p>待入驻</p>
						</a>
						<a class="border-r border-t btn-international-store2" data-name="spell" data-id="">
							<img src="App/Home/public/images/store3.png" alt="">
							<p>待入驻</p>
						</a>
						<a class="border-t btn-international-store3"  data-name="spell" data-id="">
							<img src="App/Home/public/images/store3.png" alt="">
							<p>待入驻</p>
						</a>
					</div>
				</div>
			</div>
		</section>
		<section class="star">
			<div class="title fl"><h3>本<br>市<br>明<br>星<br>企<br>业</h3></div>
			<div class="section fr">
				<div class="clearfix">
					<a class="btn-international-food" data-name="spell" data-id="222">
						<img src="App/Home/public/images/food.png" alt="">
						<p>聚餐美食</p>
					</a>
					<a class="btn-international-hotel" data-name="spell" data-id="222">
						<img src="App/Home/public/images/hotel.png" alt="">
						<p>酒店住宿</p>
					</a>
					<a class="btn-international-internet" data-name="spell" data-id="222">
						<img src="App/Home/public/images/internet.png" alt="">
						<p>网咖台球</p>
					</a>
					<a class="btn-international-tourist" data-name="spell" data-id="222">
						<img src="App/Home/public/images/tourist.png" alt="">
						<p>周边游</p>
					</a>
					<a class="btn-international-ktv" data-name="spell" data-id="222">
						<img src="App/Home/public/images/ktv.png" alt="">
						<p>KTV</p>
					</a>
					<a class="btn-international-ktv" data-name="spell" data-id="222">
						<img src="App/Home/public/images/study.png" alt="">
						<p>教育培训</p>
					</a>
				</div>
			</div>
		</section>
	</div>
	<div class="right fr">
		<a class="btn-international-Take-out-food" data-name="spell" data-id="222">
			<img src="App/Home/public/images/take-out-food.png" alt="">
			<p>校边外卖</p>
		</a>
		<a class="border-b btn-international-consumption" data-name="spell" data-id="222">
			<img src="App/Home/public/images/consume.png" alt="">
			<p>店内消费</p>
		</a>
		<a class="btn-international-leave" data-name="spell" data-id="222">
			<img src="App/Home/public/images/leave.png" alt="">
			<p>闲置吧</p>
		</a>
		<a class="btn-international-work" data-name="spell" data-id="222">
			<img src="App/Home/public/images/work.png" alt="">
			<p>工作吧</p>
		</a>
	</div>
</section>



<script src="App/Home/public/js/swiper.min.js"></script>


<script>
	// banner轮播图
	var swiper = new Swiper('.swiper-container', {
	    	pagination: '.swiper-pagination',
	   	paginationClickable: true
	});
	// 交互
	var phoneFlag = true;

	 var ua = navigator.userAgent.toLowerCase();
            if (/iphone|ipad|ipod/.test(ua)) {
                phoneFlag = true;
            } else if (/android/.test(ua)) {
                phoneFlag = false;
            }

	 $('.btn-international-movie').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalMovieInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });
         $('.btn-international-store1').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalStore1InvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-store2').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalStore2InvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	});

	$('.btn-international-store3').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalStore3InvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });
         
         $('.btn-international-food').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalFoodInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-hotel').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalHotelInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-internet').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalInternetInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-tourist').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalTouristInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-ktv').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalKtvInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-education').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalEducationInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-Take-out-food').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalTakeoutfoodInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-consumption').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalConsumptionInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-leave').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalLeaveInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	$('.btn-international-work').on('click',function(){
		var keys = $(this).data('id'); //商品类ID
	            if(phoneFlag){
	                window.webkit.messageHandlers.internationalWorkInvokeMethod.postMessage({keys:keys});
	            }else{
	                var method = "send";//js调用的android方法名
	                var action = $(this).data('name');//接口名
	                var params = { "callback":"","action":action,"keys":keys};//android接收参数，json格式
	                callAndroidMethod(method, params);
	            }

	 });

	 var callAndroidMethod = function(method, params){
                console.log(method,params)
                window.jsInterface.internationalMovieInvokeMethod(method, [JSON.stringify(params)]);//json对象转成字符串，再转成字符串数组
            }

	
         $.ajax({ //调用jquery的ajax方法   
	        type: 'post',  //设置ajax方法提交数据的形式:post,get 
	        url: 'http://119.23.27.66/Api.php/First/is_set',
	        dataType: 'json',//返回的数据类型
	        cache: 'false',//true的话会读缓存，会缓存ajax结果，第二次及更多次的调用会用缓存中的结果。false的话会在url后面加一个时间缀，让它跑到服务器获取结果。cache只有GET方式的时候有效。 
	        async: true, //（默认是true）true时，ajax请求是异步的;false为同步
	        //请求成功执行
	        success: function (data) {
	            alert('请求成功');
	        },
	        //发生错误执行
	        error: function () {
	            alert('请求发生错误');
	        }
	});
</script>	
</body>
</html>